<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
 
// import Joomla view library
jimport('joomla.application.component.view');
 
/**
 * ZOrder Publication View
 */
class ZOrderViewOrder extends JViewLegacy
{
	/**
	 * display method of Detail view
	 * @return void
	 */
	public function display($tpl = null) 
	{
		// get the Data
		$item = $this->get('Item');	
		$id = JRequest::getVar("id",0);

		JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_zorder'.DS.'tables');
				
		// Check for errors.
		if (count($errors = $this->get('Errors'))) 
		{			
			JError::raiseError(500, implode('<br />', $errors));
			return false;
		} 
		
		$item = & JTable::getInstance('Order', 'ZOrderTable');
		
		$item->load($id);
		// Assign the Data		
		$this->item = $item;
		
 		
		// Display the template
		parent::display($tpl);		
	}
}
